import { _decorator, Component, Node, Label } from 'cc';
import { IChatInfo } from '../../../entitys/EntityConst';
const { ccclass, property } = _decorator;

@ccclass('IChatController')
export class IChatController extends Component {

    //玩家名称
    @property({ type:Label, displayName:"玩家名称" })
    userName:Label = null;

    //聊天内容
    @property({ type:Label, displayName:"聊天内容" })
    content:Label = null;

    _content:IChatInfo;

    get chat(){ return this._content; }
    set chat(value){ this._content = value; this.updateChat() }

    updateChat(){

        this.userName.string = this.chat.name;
        this.content.string = this.chat.content;

    }

}

